package com.xinyu.service.impl;

import com.xinyu.domain.Alarm;
import com.xinyu.mapper.AlarmMapper;
import com.xinyu.service.IAlarmService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinyu.vo.AlarmRequest;
import com.xinyu.vo.BaseResult;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author l
 * @since 2025-02-20
 */
@Service
public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements IAlarmService {

    @Autowired
    private AlarmMapper alarmMapper;

    @Override
    public BaseResult queryByCondition(AlarmRequest alarmRequest) {
        List<Alarm> list = alarmMapper.searchAlarms(alarmRequest);
        Integer alarmCounts = alarmMapper.alarmCounts(alarmRequest);
        return BaseResult.ok(list,alarmCounts);
    }
}
